package com.prnasia.cloud.spring.pcom.feign;

import com.prnasia.cloud.spring.entity.StoryEntity;
import com.prnasia.cloud.spring.pcom.feign.fallback.StoryFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Wen Gao on 2019/4/8.
 */
@FeignClient(value = "AMP", fallback = StoryFeignFallBack.class)
public interface StoryFeignClient {

    @RequestMapping(method = RequestMethod.GET, value = "/amp/story/{id}")
    StoryEntity get(@PathVariable("id") int id);


    @PostMapping(value = "/amp/story/", consumes = MediaType.APPLICATION_JSON_VALUE)
    StoryEntity add(@RequestBody StoryEntity story);

}
